package com.nuoniu.sibanyun.mapper.erp;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.erp.ErpAccount;
import com.nuoniu.sibanyun.entity.vo.ErpAccountVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 账套信息 Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-09-22
 */
public interface ErpAccountMapper extends BaseMapper<ErpAccount> {

    @Select("SELECT * FROM fab_account WHERE company_id = #{companyId}")
    List<ErpAccountVo> listErpAccountVo(Integer companyId);

    @Select("SELECT max(id) FROM fab_account WHERE company_id = #{ companyId } AND status <= 2")
    Integer  getCurrentAccountId(Integer companyId);

}
